<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWechatUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('unionid', 50);
            $table->string('openid', 50)->comment('小程序openid');
            $table->string('wechat_openid', 50)->comment('微信openid')->nullable();
            $table->string('city', 50)->comment('城市')->nullable();
            $table->string('name', 50)->comment('名称');
            $table->string('head_img', 200)->comment('头像');
            $table->string('tele', 20)->comment('电话')->nullable();
            $table->string('wechat', 20)->comment('微信')->nullable();
            $table->integer('valid')->default(0)->comment('是否验证');
            $table->string('id_barcode', 100)->comment('身份二维码')->nullable();
            $table->string('mini_barcode', 100)->comment('身份小程序码')->nullable();
            $table->integer('point')->default(0)->comment('活跃值');
            $table->integer('score')->default(1600)->comment('积分');
            $table->integer('sect_flag')->default(0)->comment('是否加入过门派');
            $table->integer('score_flag')->default(1)->comment('显示积分');
            $table->string('weapon', 50)->comment('武器')->nullable();
            $table->string('style', 50)->comment('风格')->nullable();
            $table->integer('view')->default(0)->comment('查看次数');
            $table->integer('winning_streak')->default(0)->comment('连胜');
            $table->integer('max_winning_streak')->default(0)->comment('最高连胜');
            $table->integer('is_true')->default(1)->comment('虚拟')->nullable();

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechat_users');
    }
}
